<?xml version="1.0" encoding="UTF-8"?>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ page language="java" pageEncoding="UTF-8"%>
<% request.setCharacterEncoding("UTF-8"); %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="hu" lang="hu">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link type="text/css" rel="stylesheet" media="all" href="resources/css/game.css" />
<script type="text/javascript" src="resources/js/game.js"></script>
<script type="text/javascript" src="resources/js/ajaxHandler.js"></script>
<title>Mancala Game</title>
</head>
<body>

<jsp:useBean id="player" class="com.uzletiwebtech.mancala.User" scope="session"></jsp:useBean>
<jsp:setProperty name="player" property="*" />
<c:if test="${empty player.fullName }">
	<jsp:forward page="CommonServlet" />
</c:if>

<div class="common">
Playing with the Computer. <br/>
Your name: <c:out value="${player.fullName}"></c:out><br />
<input type="submit" value="Start" class="button" onclick="startGame()" />
Time played: <label id="time_played"> seconds</label>
<input type="submit" value="Stop" class="button" onclick="stopGame()" />
</div>

<div id="gameTable">
	<table>
	
	<tr id="Computer">
		<td>0</td>
		<td><input type="submit" class="button disabled" value="4"/></td>
		<td><input type="submit" class="button disabled" value="4"/></td>
		<td><input type="submit" class="button disabled" value="4"/></td>
		<td><input type="submit" class="button disabled" value="4"/></td>
		<td><input type="submit" class="button disabled" value="4"/></td>
		<td><input type="submit" class="button disabled" value="4"/></td>
		<td>Computer</td>
	</tr>
	
	<tr id="Player">
		<td><c:out value="${player.fullName}"></c:out></td>
		<td><input type="submit" class="button disabled" onclick="playerTurn(1);" value="4"/></td>
		<td><input type="submit" class="button disabled" onclick="playerTurn(2);" value="4"/></td>
		<td><input type="submit" class="button disabled" onclick="playerTurn(3);" value="4"/></td>
		<td><input type="submit" class="button disabled" onclick="playerTurn(4);" value="4"/></td>
		<td><input type="submit" class="button disabled" onclick="playerTurn(5);" value="4"/></td>
		<td><input type="submit" class="button disabled" onclick="playerTurn(6);" value="4"/></td>
		<td>0</td>
	</tr>
	
	</table>
</div>


</body>
</html>